package com.nice.nice201110.service;

import com.nice.nice201110.entity.TButton;
import com.nice.nice201110.entity.TMenu;
import com.nice.nice201110.mapper.TButtonMapper;
import com.nice.nice201110.mapper.TButtonPowerMapper;
import com.nice.nice201110.mapper.TMenuMapper;
import com.nice.nice201110.mapper.TMenuPowerMapper;
import com.nice.nice201110.vo.BaseVo;
import com.nice.nice201110.vo.MenuVo;
import com.nice.nice201110.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 *  操作： 菜单 按钮  及 权限
 *
 */

@Service
public class OperationService {

    @Autowired
    TButtonMapper tButtonMapper;   //  按钮DB

    @Autowired
    TMenuMapper tMenuMapper; //菜单DB

    @Autowired
    TButtonPowerMapper tButtonPowerMapper;   // 按钮权限DB

    @Autowired
    TMenuPowerMapper tMenuPowerMapper;    //菜单权限DB

    //获取当前用户应该有的按钮
    public List<TButton> getButtonList(UserVo userVo,Integer menuid){
        return tButtonMapper.selectByUserMenu(userVo,menuid);
    }
    //获取当前用户应该有的菜单
    public List<TMenu> getMenuList(MenuVo menuVo){
        return tMenuMapper.selectByTmenus(menuVo);
    }




}
